<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <title>SYZOJ</title>
    <link rel="shortcut icon" href="{{url_for('static',filename='syzoj_32.ico')}}" /> 
    <!-- For 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- For Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href=" {{ url_for('static', filename='amazeui.min.css') }} ">
    <style type="text/css">
        .am-container {
        width: 980px !important;
        max-width: none;
        }
        .nav-link{
        color: #fff;
        }
        .icon-48{
            width: 36px;
            height: 36px;
        }
        textarea,body{
            text-rendering: auto;
        }
    </style>
</head>

<body class="am-with-topbar-fixed-top">
<header class="am-topbar am-topbar-fixed-top">
    <div class="am-container">
        <h1 class="am-topbar-brand">
            <a href="{{ url_for('index') }}"><img src="{{url_for('static',filename='syzoj-logo.png')}}" class="icon-48">SYZOJ</a>
        </h1>

        <div class="am-topbar-collapse">
            <div class="am-topbar-left">
                <ul class="am-nav am-nav-pills am-topbar-nav">
                    <li class="{% if tab=='index' %}am-active {% endif %}"><a href="{{ url_for('index') }}"
                                                                              class="nav-link">首页</a></li>
                    <li class="{% if tab=='problem_set' %}am-active {% endif %}"><a href="{{ url_for('problem_set') }}">题库</a>
                    </li>
                    <li class="{% if tab=='judge' %}am-active {% endif %}"><a href="{{ url_for('judge_state') }}">评测</a></li>
                    <li class="{% if tab=='ranklist' %}am-active {% endif %}"><a href="{{url_for('ranklist')}}">排名</a></li>
                    <li class="{% block contest_tab %}{% endblock %}"><a href="{{ url_for('contest_list') }}">比赛</a>
                    </li>
                    <li class="{% if tab=='discussion'%}am-active{% endif %}"><a href="{{url_for('discussion')}}">讨论</a></li>
                </ul>
            </div>
            {% set user=tool.get_cur_user() %}
            {% if user %}
            <div class="am-topbar-right">
                <ul class="am-nav am-nav-pills am-topbar-nav">
                    <li class="am-dropdown" data-am-dropdown>
                        <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
                            {{user.nickname}} <span class="am-icon-caret-down"></span>
                        </a>
                        <ul class="am-dropdown-content">
                            <li><a href="{{url_for('user',user_id=user.id)}}"><span class="am-icon-user"></span> 资料</a></li>
                            <li><a href="{{url_for('edit_user',user_id=user.id)}}"><span class="am-icon-cog"></span> 设置</a></li>
                            <li><a href="#" id="logout"><span class="am-icon-power-off"></span> 注销</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
            {% else %}
            <div class="am-topbar-right">
                <button class="am-btn am-btn-primary am-topbar-btn am-btn-sm"
                        onclick="window.location.href='{{ url_for('login')}}'">登录
                </button>
                <button class="am-btn am-btn-secondary am-topbar-btn am-btn-sm"
                        onclick="window.location.href='{{ url_for('sign_up') }}'">注册
                </button>
            </div>
            {% endif %}
        </div>
    </div>
</header>

{% block body %}{% endblock %}

<script src="{{ url_for('static', filename='jquery.min.js') }}"></script>
<script src="{{ url_for('static', filename='amazeui.min.js') }}"></script>
<script src="{{ url_for('static', filename='jquery.ext.js') }}"></script>

<script src="{{ url_for('static', filename='prettify.js') }}"></script>
<link rel="stylesheet" href="{{url_for('static', filename='prettify.css') }}" type="text/css"/>

<script type="text/javascript">
function logout(){
    //alert($.cookie("session_id"));
    url='/api/logout?session_id='+$.cookie("session_id");
    url=encodeURI(url);
    $.ajax({
        url : url,
        type : 'POST',
        async:false,
    });
}
$("#logout").click(function(){
    logout();
    alert("我早已习惯你不在身边，\n人间四月天 寂寞断了弦。\n回望身后蓝天，\n跟再见说再见……\n  --《貂蝉》");
    window.location.href="{{url_for('login')}}";
});
$(document).ready(function(){
    $("pre").addClass("prettyprint");
    prettyPrint();
});
</script>
{% block script %}{% endblock %}

<footer data-am-widget="footer" class="am-footer am-footer-default">
    <div class="am-footer-miscs ">
       <p>CopyRight©2015 郑州市第十一中学.<a href="http://www.miibeian.gov.cn/" target="_blank">豫ICP备15011071号</a></p>
    </div>
    <div class="am-footer-miscs ">
       <p>郑州十一中在线评测系统基于开源系统<a href="https://github.com/Chenyao2333/syzoj" target="_blank">SYZOJ</a>.</p>
    </div>
</footer>
</body>
</html>
